<?php

class timer {
	
	private $start = 0;
	
	private $stop = 0;
	
	function __construct($start = false) {
		if ($start === true) {
			$this->start();
		}
	}
	
	function __destruct() {
		
	}
	
	function start() {
		$this->stop = $this->start = microtime(true);
	}
	
	function stop() {
		$this->stop = microtime(true);
	}
	
	function get_result() {
		return $this->stop - $this->start;
	}
}

?>
